import { createApp } from 'vue'
import App from './App.vue'

/*element-plus*/
import ElementPlus from 'element-plus'
/*element-plus样式*/
import 'element-plus/dist/index.css'
import router from "@/router/router";

/*调整页面报错解决*/
const debounce = (fn, delay) => {
    let timer
    return (...args) => {
        if (timer) {
            clearTimeout(timer)
        }
        timer = setTimeout(() => {
            fn(...args)
        }, delay)
    }
}

let app = createApp(App);
    app.use(ElementPlus)
    app.use(router)
    app.mount('#app')



const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver{
    constructor(callback) {
        callback = debounce(callback, 200);
        super(callback);
    }
}